<{include file="scenter/block/header.html"}>
<div class="ucenter_t">
    <ul>
        <li class="<{if $pager.type=='all'}>on<{/if}>"><a href="<{link ctl='scenter/shop/order:index'}>" >全部订单</a></li>
        <li class="<{if $pager.type=='unpay'}>on<{/if}>"><a href="<{link ctl='scenter/shop/order:index' arg0='unpay'}>">未付款</a></li>
        <li class="<{if $pager.type=='payed'}>on<{/if}>"><a href="<{link ctl='scenter/shop/order:index' arg0='payed'}>">已付款</a></li>
        <li class="<{if $pager.type=='unship'}>on<{/if}>"><a href="<{link ctl='scenter/shop/order:index' arg0='unship'}>">待发货</a></li>
        <li class="<{if $pager.type=='ship'}>on<{/if}>"><a href="<{link ctl='scenter/shop/order:index' arg0='ship'}>">已发货</a></li>
        <li class="<{if $pager.type=='finish'}>on<{/if}>"><a href="<{link ctl='scenter/shop/order:index' arg0='finish'}>">已完成</a></li>
    </ul>
</div>
<div class="ucenter_c">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="order_table table">
    <{foreach $items as $order}>
    <tbody class="tbody">
    <tr class="th">
        <td colspan="10">
            <label class="no">订单号：<b class="red"><{$order.order_no}></b></label>
            <label class="time">下单时间：<{$order.dateline|format:"Y-m-d H:i:s"}></label>
            <label class="shop">买家：<{$member_list[$order.uid].uname|default:'--'}></label>
            <span class="order"><a href="<{link ctl='mall/order:detail' arg0=$order.order_no}>" target="_blank">订单详情</a></span>
        </td>
    </tr>
    <{assign var="first" value=true}>
    <{foreach $product_list as $product}>
    <{if $product.order_id == $order.order_id}>
    <tr class="td">
        <td class="order-product w-50">
            <a href="<{link ctl='mall/product:detail' arg0=$product.product_id}>" target="_blank"><img src="<{$pager.img}>/<{$product.photo}>_small.jpg" photo="<{$pager.img}>/<{$product.photo}>_thumb.jpg" class="wh-50" style="margin:3px;"></a>
        </td>
        <td><a href="<{link ctl='mall/product:detail' arg0=$product.product_id}>" target="_blank"><{$product.product_name}></a><{if $product.spec_id}><br/>规格：<{$product.spec_name}><{/if}></td>
        <td><{$product.product_price}> x <{$product.number}></td>
        <{if $first}>
        <td rowspan="<{$order.product_number}>" class="pay-status w-150">
        ￥<{$order.amount }><span class="gray">(<{if $order.freight>0}>运费：￥<{$order.freight}><{else}>包邮<{/if}>)</span><br/>
         <{if $order.order_status < 2 && $order.order_status >=0}>
            <{if $order.pay_status}><b class="blue"><a>已经支付</a></b><{else}><b class="red">等待支付</b><{/if}>
         <{/if}>
        </td>
        <td rowspan="<{$order.product_number}>" class="order-status w-150">
            <{if $order.order_status == 2}><b class="gray">订单完成</b>
            <{elseif $order.order_status == 1}><b class="gray">订单已发货<br />等待买家确认收货</b>
            <{elseif $order.order_status < 0}><b class="gray">订单已经取消</b>
            <{elseif empty($order.pay_status)}>
                <a href="<{link ctl='scenter/shop/order:update' arg0='ship' arg1=$order.order_no}>" mini-act="confirm:您确定要该订单已发货？" class="btn_ship">订单发货</a><br/>
                <a href="<{link ctl='scenter/shop/order:update' arg0='cancel' arg1=$order.order_no}>" mini-act="confirm:您确定要取消订单？" class="btn_cancel">取消订单</span>
            <{else}><a href="<{link ctl='scenter/shop/order:update' arg0='ship' arg1=$order.order_no}>" mini-act="confirm:您确定要该订单已发货？" class="btn_ship">订单发货</a>
            <{/if}>
            <p></p>
        </td>
        <{/if}>
    </tr>
    <{assign var="first" value=false}>
    <{/if}>
    <{/foreach}>
    </tbody>
    <tr><td colspan="10" style="border:none;height:5px">&nbsp;</td></tr>
	<{foreachelse}>
    <tr><td colspan="10"><p class="tips"><span class="notice">没有您要找的订单</span></p></td></tr>
    <{/foreach}>
</table>
<p class="page"><{$pager.pagebar}></p>
</div>
<{include file="scenter/block/footer.html"}>